/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cifar10.featureextraction;

import de.lmu.ifi.dbs.jfeaturelib.features.AutoColorCorrelogram;
import de.lmu.ifi.dbs.jfeaturelib.features.FeatureDescriptor;
import ij.process.ColorProcessor;
import java.awt.image.BufferedImage;

/**
 *
 * @author mwh
 */
public class AutoColorCorrelogramWrapper extends AbstractFixedSizeFeatureExractor implements FixedSizeFeatureExtractor{

    public AutoColorCorrelogramWrapper() {
        name = "AutoColorCorrelogramWrapper";
        size = 768;
        featuresNames = new String[size];
        for (int i = 1; i <= size; i++) {
            featuresNames[i - 1] = "ACC" + i;
        }

    }

    @Override
    public double[] getValues(BufferedImage image) {

        ColorProcessor colorProcessor = new ColorProcessor(image);

        FeatureDescriptor descriptor = getNewDescriptor();
        descriptor.run(colorProcessor);
        double[] featureValues = descriptor.getFeatures().get(0);

        return featureValues;
    }

    static FeatureDescriptor getNewDescriptor() {
        return new AutoColorCorrelogram();

    }

}
